<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="../../css/font.css">
    <link rel="stylesheet" href="../../css/xadmin.css">
    <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="x-nav">
			<span class="layui-breadcrumb">
            <a href="javascript:;">项目</a>
            <a>
              <cite>所有项目</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div style="padding-top: 15px">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-tab layui-tab-brief" lay-filter="demo">
                <ul class="layui-tab-title">
                    <li class="layui-this">与我相关</li>
                </ul>
                <div class="layui-tab-content" style="padding-left: 0px">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-card">
                            <div class="layui-card-body ">
                                <table class="layui-hide" id="projectTable" lay-filter="test"></table>
                                <script type="text/html" id="processTpl">
                                    <div class="layui-progress" lay-showpercent="true" style="margin-top: 15px">
                                        <div class="layui-progress-bar" lay-percent="{{d.projectProcess+'%'}}"></div>
                                    </div>
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['laydate', 'form', 'laypage', 'layer', 'table', 'element', 'carousel'], function () {
        var laydate = layui.laydate;
        var form = layui.form;
        var laypage = layui.laypage;
        var layer = layui.layer;
        var table = layui.table;
        var element = layui.element;
        var carousel = layui.carousel;
        var $=layui.jquery;
        var laytpl=layui.laytpl;

        //进行中的项目表
        table.render({
            elem:'#projectTable'
            ,cellMinWidth:80
            , height: 300
            ,url: 'http://localhost:8080/project/list' //数据接口
            , title: '项目表'
            , page: true //开启分页
            , toolbar: true //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
            ,defaultToolbar:['filter', 'exports']
            ,cols: [[
                {field:'projectName',width:'20%',minWidth: 80,title:'项目名称',sort:true}
                ,{field:'projectCode',width:'20%',minWidth: 80,title:'项目代号',sort:true}
                ,{field:'projectEndDate',minWidth: 100,title:'截止时间',sort:true}
                ,{field:'projectStatus',minWidth: 80,title:'状态',sort:true}
                ,{field:'totalHours',minWidth: 80,title:'预计',sort:true}
                ,{field:'usedHours',minWidth: 80,title:'消耗',sort:true}
                ,{field:'leftHours',minWidth: 80,title:'剩余',sort:true}
                ,{field:'projectProcess',width:'15%',minWidth: 80,title:'进度',sort:true,templet:'#processTpl',unresize: true}
            ]]
            ,done:function (res, curr, count) {
                element.init();
            }
        });
        // 监听全选
        form.on('checkbox(checkall)', function (data) {

            if (data.elem.checked) {
                $('tbody input').prop('checked', true);
            } else {
                $('tbody input').prop('checked', false);
            }
            form.render('checkbox');
        });
    });
</script>
</body>

</html>